Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[C++] Add static reflection / stringification for enums (#6499) #8432

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ajrh1
Copy link

@ajrh1 ajrh1 commented Oct 27, 2024

Add an EnumTraits class, templated on the enum type, largely as proposed in #6499, except in the generated namespace.

Add overloaded EnumValTraits(T) to return the traits class via ADL.

Add GetEnumName(T t) helper for the common case of finding the enum string name from its value.

Changed the cpp17 test and expected test output for stringified enums.

ajrh1 added 3 commits October 27, 2024 14:55
Add an EnumTraits<T> class, templated on the enum type, as proposed in google#6499.

Add overloaded EnumValTraits(T) to return the traits class via ADL.

Add GetEnumName(T t) helper for the common case of finding the enum
string name from its value.
Copy link

google-cla bot commented Oct 27, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@github-actions github-actions bot added c++ codegen Involving generating code from schema labels Oct 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ codegen Involving generating code from schema
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant